﻿<Serializable()> _
Public Class ServerExtension
    Implements IExtension

    Private instance As IExtension
    Public Property ExtensionInstance() As IExtension
        Get
            If (instance Is Nothing) Then Throw New Exception("Extension instance was not resolved.")
            Return instance
        End Get
        Set(ByVal value As IExtension)
            instance = value
        End Set
    End Property


    Private asm As System.Reflection.Assembly
    Public Property AssemblyInstance() As System.Reflection.Assembly
        Get
            Return asm
        End Get
        Set(ByVal value As System.Reflection.Assembly)
            asm = value
        End Set
    End Property


    Private type As System.Type
    Public Property ExtensionType() As System.Type
        Get
            If (instance Is Nothing) Then Throw New Exception("Extension Type was not resolved.")
            Return type
        End Get
        Set(ByVal value As System.Type)
            type = value
        End Set
    End Property

    Public ReadOnly Property ExtensionID() As System.Guid Implements IExtension.ExtensionID
        Get
            Return ExtensionInstance.ExtensionID
        End Get
    End Property

    Private method As String
    Public Property MethodName As String
        Get
            Return method
        End Get
        Set(ByVal value As String)
            method = value
        End Set
    End Property


    Private userInfoProp As System.Reflection.PropertyInfo
    Public Property UserInfoProperty() As System.Reflection.PropertyInfo
        Get
            Return userInfoProp
        End Get
        Set(ByVal value As System.Reflection.PropertyInfo)
            userInfoProp = value
        End Set
    End Property


    Private methodInst As System.Reflection.MethodInfo
    Public Property MethodInstance() As System.Reflection.MethodInfo
        Get
            Return methodInst
        End Get
        Set(ByVal value As System.Reflection.MethodInfo)
            methodInst = value
        End Set
    End Property

    Public ReadOnly Property AssemblyName As String Implements IExtension.AssemblyName
        Get
            Return ExtensionInstance.AssemblyName
        End Get
    End Property

    Public ReadOnly Property TypeName As String Implements IExtension.TypeName
        Get
            Return ExtensionInstance.TypeName
        End Get
    End Property


    Private uInfo As DotNetNuke.Entities.Users.UserInfo
    Public Property UserInfo() As DotNetNuke.Entities.Users.UserInfo Implements IExtension.UserInfo
        Get
            Return uInfo
        End Get
        Set(ByVal value As DotNetNuke.Entities.Users.UserInfo)
            uInfo = value
        End Set
    End Property


End Class
